# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  include Authentication
  include RoleRequirementSystem
  include Application
  
  # authentication required
  before_filter :login_required

  #helper :all # include all helpers, all the time
  helper :layout
  #protect_from_forgery # See ActionController::RequestForgeryProtection for details

  # Scrub sensitive parameters from your log
  filter_parameter_logging :password

  CalendarDateSelect.format = :italian
  Paperclip::Attachment.default_options[:url] = "#{APP_CONFIG[:url_prefix]}/DATA/:class/:attachment/:id_partition/:style/:basename.:extension"
  Paperclip::Attachment.default_options[:path] = ":rails_root/public/DATA/:class/:attachment/:id_partition/:style/:basename.:extension"
  WillPaginate::ViewHelpers.pagination_options[:previous_label] = '&laquo; Precedente'
  WillPaginate::ViewHelpers.pagination_options[:next_label] = 'Successivo &raquo;'
  Irwi.config.paginator = Irwi::Paginators::WillPaginate.new
  Irwi.config.formatter = Irwi::Formatters::RedCloth.new
  #Irwi.config.formatter = Irwi::Formatters::BlueCloth.new
  ValidatesTimeliness::Formats.remove_us_formats

  ## overrides methods for active_scaffold
  def do_before_create_save(record) ; end
  def do_before_update_save(record) ; end
  def do_create_authorized? ; end
  def do_update_authorized? ; end
  def do_delete_authorized? ; end
end
